package com.shuzijun.leetcode.editor.cn;
public class SparseArraySearchLcci{
    public static void main(String[] args) {
         Solution solution = new SparseArraySearchLcci().new Solution();
        
    }
    //leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public int findString(String[] words, String s) {
        int low = 0;
        int high = words.length-1;
       while (low <= high){
           int mid = (low+high)/2;
           if (words[mid].equals(s)){
               return mid;
           } else if (words[mid].equals("")) {
               if (words[low].equals(s))return low;
               else low++;

           } else if (words[mid].compareTo(s) <0) {
               low = mid+1;
           }else {
               high = mid-1;
           }
       }
       return -1;
    }
}
//leetcode submit region end(Prohibit modification and deletion)

}